# 任务中心
# 用来调度任务

from globally import server_version
import time
from Class_TaskProcessing import AssignmentPlat, ExecPlat

class TaskCenter:
    @classmethod
    # 任务：增量更新
    def _incremental_update(cls, version):
        start_time = time.time()
        assignment_list = AssignmentPlat().create_assignments(version)
        ExecPlat.handle_assignments(assignment_list)
        end_time = time.time()
        print("%s 用时： %.1d 分钟" % (version, (end_time - start_time) / 60))


    # 对外任务模块接口，version举例v10sp3_x86_64
    def task(self, version):
        self._incremental_update(version)
